<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h1>解构赋值</h1>
    <script>
        var arr = ['jack', 20, '男', '美国']
        // var [name, age] = arr
        var [name, ...arr1] = arr
        console.log(name, arr1);


        var obj = { name: "rose", gender: "女", age: 20, city: '北京' }
        // var { name, age, gender: sex } = obj
        var { name, age, ...user } = obj
        console.log(name, age,user);

    </script>
</body>

</html>